package po;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;

public class CatagoryPO implements Serializable{
	private static final long serialVersionUID = 1L;
	
	private String name;
	private ArrayList<CatagoryPO> subCatagoryPO;
	
	

	public CatagoryPO(String name,ArrayList<CatagoryPO> subCatagoryPO){
		this.name=name;
		this.subCatagoryPO=subCatagoryPO;
	}
	
	public String getName(){
		return name;
	}
	
	public boolean hasSubCatagory(){
		return subCatagoryPO.size() != 0;
	}
	
	public Iterator<CatagoryPO> getSubCatagory(){
		return subCatagoryPO.listIterator();
	}
	
	public boolean isRoot(){
		return name==null;
	}
	
	
	public ArrayList<CatagoryPO> getSubCatagoryPO() {
		return subCatagoryPO;
	}
}
